﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Includes;
using System.Windows.Forms.DataVisualization.Charting;

namespace Arztmodul
{
   /// <summary>
   /// Provides neccessairy functions for persisting and retrieving patients and their data
   /// </summary>
   public interface IPersistDoc
   {
       /// <summary>
       /// Tests whether connection to persistance layer is established, or could be established
       /// </summary>
       /// <returns> true if connection has been established, false otherwise </returns>
       bool connect();


       /// <summary>
       /// Persists a patientlogic object
       /// </summary>
       /// <param name="patient"> Patient to persist </param>
       /// <returns> true if successfully persisted, false otherwise </returns>
       bool setPatient(Patient patient);


       /// <summary>
       /// Gets patient by first and last name
       /// </summary>
       /// <param name="name"> Last name of patient </param>
       /// <param name="firstName"> First name of patient </param>
       /// <returns> Patient Logic object containing patient information </returns>
       Patient getPatient(String name, String firstName);


       /// <summary>
       /// Checks whether Patient exists
       /// </summary>
       /// <param name="name"> Last name of patient </param>
       /// <param name="firstName"> First name of patient </param>
       /// <returns> True if patient exists, false otherwise </returns>
       bool patientExists(String name, String firstName);

       /// <summary>
       /// Checks whether Patient exists
       /// </summary>
       /// <param name="patient"> Patient to check for </param>
       /// <returns> True if patient exists, false otherwise </returns>
       bool patientExists(Patient patient);


       /// <summary>
       /// Gets Vitaldata history of patient
       /// </summary>
       /// <param name="name"> Last name of patient </param>
       /// <param name="firstName"> First name of patient </param>
       /// <returns> VData set </returns>
       VData[] getHistory(String name, String firstName);

       /// <summary>
       /// Gets Vitaldata history of patient
       /// </summary>
       /// <param name="patient"> Patient to check for </param>
       /// <returns> VData set </returns>
       VData[] getHistory(Patient patient);

   
       /// <summary>
       /// Method to get formated vitalData as gridChart
       /// </summary>
       /// <param name="firstName"> first name of patient </param>
       /// <param name="lastName"> last name of patient </param>
       /// <returns>n objects[](lines) with m strings(columns)(first object is headline, youngest date first), null if mistake</returns>
       object[] getVitalDataGrid(String lastName, String firstName);

       /// <summary>
       /// Method to get formated vitalData as gridChart
       /// </summary>
       /// <param name="patient"> Patient to check for </param>
       /// <returns> objects[](lines) with m strings(columns)(first object is headline, youngest date first), null if mistake</returns>
       object[] getVitalDataGrid(Patient patient);


       /// <summary>
       /// Method to get formated vitalData as lineChart 
       /// every series contains all points
       /// </summary>
       /// <param name="firstName"> first name of patient </param>
       /// <param name="lastName"> last name of patient </param>
       /// <returns>([0]=BloodPressure, [1]=Pulse, [2]=Weight) of this person, null if mistake</returns>
       Series[] getVitalDataChart(String lastName, String firstName);

       /// <summary>
       /// Method to get formated vitalData as lineChart 
       /// every series contains all points
       /// </summary>
       /// <param name="patient"> Patient of the needed data </param>
       /// <returns>([0]=BloodPressure, [1]=Pulse, [2]=Weight) of this person, null if mistake</returns>
       Series[] getVitalDataChart(Patient patient);
   }
}
